package com.zhou.piledriver.controller;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.zhou.piledriver.common.PageRequest;
import com.zhou.piledriver.common.R;
import com.zhou.piledriver.common.ResponseResult;
import com.zhou.piledriver.model.so.RecordSo;
import com.zhou.piledriver.service.PdDeviceRecordService;
import io.swagger.v3.oas.annotations.Operation;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author ZhouShenBin
 * @date 2024/3/21 8:55
 * @description
 */
@RestController
@RequestMapping("/record")
public class PdDeviceRecordController {

    @Resource
    private PdDeviceRecordService pdDeviceRecordService;
    @PostMapping("/list")
    @Operation(summary = "历史记录分页")
    public ResponseResult list(@RequestBody PageRequest<RecordSo> so) {
        return R.success(pdDeviceRecordService.list(new Page<>(so.getCurrent(), so.getSize()), so.getQuery()));
    }
}
